3.24 \(\int \csc (c+d x) (a+a \sec (c+d x))^2 \, dx\)

Optimal. Leaf size=48 \[ \frac {a^2 \sec (c+d x)}{d}+\frac {2 a^2 \log (1-\cos (c+d x))}{d}-\frac {2 a^2 \log (\cos (c+d x))}{d} \]

[Out]

2*a^2*ln(1-cos(d*x+c))/d-2*a^2*ln(cos(d*x+c))/d+a^2*sec(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.12, antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {3872, 2836, 12, 77} \[ \frac {a^2 \sec (c+d x)}{d}+\frac {2 a^2 \log (1-\cos (c+d x))}{d}-\frac {2 a^2 \log (\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[Csc[c + d*x]*(a + a*Sec[c + d*x])^2,x]

[Out]

(2*a^2*Log[1 - Cos[c + d*x]])/d - (2*a^2*Log[Cos[c + d*x]])/d + (a^2*Sec[c + d*x])/d

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 2836

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^(m + (p - 1)/2)*(a - x)^((p - 1)/2)*(c + (d*x)/b
)^n, x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, c, d, m, n}, x] && IntegerQ[(p - 1)/2] && EqQ[a^2 - b^2,
 0]

Rule 3872

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[((g*C
os[e + f*x])^p*(b + a*Sin[e + f*x])^m)/Sin[e + f*x]^m, x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]

Rubi steps

\begin {align*} \int \csc (c+d x) (a+a \sec (c+d x))^2 \, dx &=\int (-a-a \cos (c+d x))^2 \csc (c+d x) \sec ^2(c+d x) \, dx\\ &=\frac {a \operatorname {Subst}\left (\int \frac {a^2 (-a+x)}{(-a-x) x^2} \, dx,x,-a \cos (c+d x)\right )}{d}\\ &=\frac {a^3 \operatorname {Subst}\left (\int \frac {-a+x}{(-a-x) x^2} \, dx,x,-a \cos (c+d x)\right )}{d}\\ &=\frac {a^3 \operatorname {Subst}\left (\int \left (\frac {1}{x^2}-\frac {2}{a x}+\frac {2}{a (a+x)}\right ) \, dx,x,-a \cos (c+d x)\right )}{d}\\ &=\frac {2 a^2 \log (1-\cos (c+d x))}{d}-\frac {2 a^2 \log (\cos (c+d x))}{d}+\frac {a^2 \sec (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.09, size = 36, normalized size = 0.75 \[ \frac {a^2 \left (\sec (c+d x)+4 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-2 \log (\cos (c+d x))\right )}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[c + d*x]*(a + a*Sec[c + d*x])^2,x]

[Out]

(a^2*(-2*Log[Cos[c + d*x]] + 4*Log[Sin[(c + d*x)/2]] + Sec[c + d*x]))/d

________________________________________________________________________________________

fricas [A]  time = 0.69, size = 61, normalized size = 1.27 \[ -\frac {2 \, a^{2} \cos \left (d x + c\right ) \log \left (-\cos \left (d x + c\right )\right ) - 2 \, a^{2} \cos \left (d x + c\right ) \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - a^{2}}{d \cos \left (d x + c\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+a*sec(d*x+c))^2,x, algorithm="fricas")

[Out]

-(2*a^2*cos(d*x + c)*log(-cos(d*x + c)) - 2*a^2*cos(d*x + c)*log(-1/2*cos(d*x + c) + 1/2) - a^2)/(d*cos(d*x +
c))

________________________________________________________________________________________

giac [B]  time = 0.28, size = 115, normalized size = 2.40 \[ \frac {2 \, {\left (a^{2} \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right ) - a^{2} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right ) + \frac {2 \, a^{2} + \frac {a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}}{\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1}\right )}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+a*sec(d*x+c))^2,x, algorithm="giac")

[Out]

2*(a^2*log(abs(-cos(d*x + c) + 1)/abs(cos(d*x + c) + 1)) - a^2*log(abs(-(cos(d*x + c) - 1)/(cos(d*x + c) + 1)
- 1)) + (2*a^2 + a^2*(cos(d*x + c) - 1)/(cos(d*x + c) + 1))/((cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 1))/d

________________________________________________________________________________________

maple [A]  time = 0.41, size = 32, normalized size = 0.67 \[ \frac {a^{2} \sec \left (d x +c \right )}{d}+\frac {2 a^{2} \ln \left (-1+\sec \left (d x +c \right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(d*x+c)*(a+a*sec(d*x+c))^2,x)

[Out]

a^2*sec(d*x+c)/d+2/d*a^2*ln(-1+sec(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 0.33, size = 43, normalized size = 0.90 \[ \frac {2 \, a^{2} \log \left (\cos \left (d x + c\right ) - 1\right ) - 2 \, a^{2} \log \left (\cos \left (d x + c\right )\right ) + \frac {a^{2}}{\cos \left (d x + c\right )}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+a*sec(d*x+c))^2,x, algorithm="maxima")

[Out]

(2*a^2*log(cos(d*x + c) - 1) - 2*a^2*log(cos(d*x + c)) + a^2/cos(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 0.08, size = 35, normalized size = 0.73 \[ \frac {a^2}{d\,\cos \left (c+d\,x\right )}-\frac {4\,a^2\,\mathrm {atanh}\left (2\,\cos \left (c+d\,x\right )-1\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a/cos(c + d*x))^2/sin(c + d*x),x)

[Out]

a^2/(d*cos(c + d*x)) - (4*a^2*atanh(2*cos(c + d*x) - 1))/d

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ a^{2} \left (\int 2 \csc {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int \csc {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int \csc {\left (c + d x \right )}\, dx\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+a*sec(d*x+c))**2,x)

[Out]

a**2*(Integral(2*csc(c + d*x)*sec(c + d*x), x) + Integral(csc(c + d*x)*sec(c + d*x)**2, x) + Integral(csc(c +
d*x), x))

________________________________________________________________________________________